num_people = int(input("请输入宿舍人数："))
total_cost = float(input("请输入宿舍总电费："))
costs = []
for i in range(num_people):
    print(f"请输入第{i + 1}个人的信息：")
    power = []
    time = []
    num_appliances = int(input("请输入电器数量："))
    for j in range(num_appliances):
        p = float(input(f"请输入第{j + 1}个电器的功率（单位：瓦）："))
        t = float(input(f"请输入第{j + 1}个电器每天的使用时间（单位：小时）："))
        power.append(p)
        time.append(t)
    total_power = sum([p * t for p, t in zip(power, time)])
    costs.append(total_power)
total_power_sum = sum(costs)
for i in range(num_people):
    cost = (costs[i] / total_power_sum) * total_cost
    print(f"第{i + 1}个人应支付的电费为：{cost:.2f}元")